<?php

$router = new Phalcon\Mvc\Router();

$router->add("/:controller/:action/:params", array(
    'module' => 'frontend',
    'controller' => 1,
    'action' => 2,
    'params' => 3,
));

// ----- Users -----
$router->add('/confirm/{code}/{email}', array(
    'controller' => 'user',
    'action' => 'confirmEmail'
));
$router->setDefaults(array(
    'module' => 'frontend',
    'controller' => 'index',
    'action' => 'index'
));
$router->add("/login", array(
    'module' => 'frontend',
    'controller' => 'user',
    'action' => 'login'
));
$router->add("/index", array(
    'module' => 'frontend',
    'controller' => 'index',
    'action' => 'index'
));
$router->add("/signup", array(
    'controller' => 'user',
    'action' => 'signup'
));
$router->add("/logout", array(
    'controller' => 'user',
    'action' => 'logout'
));
$router->add("/upload", array(
    'controller' => 'upload',
    'action' => 'upload'
));
$router->add("/resetpassword", array(
    'controller' => 'user',
    'action' => 'resetpassword'
));
$router->add("/aboutus", array(
    'controller' => 'help',
    'action' => 'about'
));
$router->add("/security", array(
    'controller' => 'help',
    'action' => 'security'
));
$router->add("/user_guide", array(
    'controller' => 'help',
    'action' => 'guide'
));
$router->add("/money", array(
    'controller' => 'help',
    'action' => 'money'
));
$router->add("/contact", array(
    'controller' => 'help',
    'action' => 'contact'
));

$router->add("/search", array(
    'controller' => 'index',
    'action' => 'search'
));
$router->add("/profile", array(
    'module' => 'frontend',
    'controller' => 'user',
    'action' => 'profile'
));
$router->add("/changepass", array(
    'module' => 'frontend',
    'controller' => 'user',
    'action' => 'changepass'
));
$router->add("/downhistory", array(
    'module' => 'frontend',
    'controller' => 'user',
    'action' => 'downhistory'
));
$router->add("/uploadhistory", array(
    'module' => 'frontend',
    'controller' => 'user',
    'action' => 'uploadhistory'
));
$router->add("/recharge", array(
    'module' => 'frontend',
    'controller' => 'user',
    'action' => 'recharge'
));
$router->add("/rechargebypoint", array(
    'module' => 'frontend',
    'controller' => 'user',
    'action' => 'rechargebypoint'
));
$router->add("/exchange", array(
    'module' => 'frontend',
    'controller' => 'user',
    'action' => 'exchange'
));

$router->add("/doc/view/{id}", array(
    'controller' => 'doc',
    'action' => 'view'
));

/* Admin login */
$router->add("/admin/login", array(
    'module' => 'adminlogin',
    'controller' => 'adminlogin',
    'action' => 'login',
));

$router->add("/admin/accessdenied", array(
    'module' => 'adminlogin',
    'controller' => 'adminerrorlogin',
    'action' => 'accessdenied',
));

/* Admin router */
$router->add("/admin", array(
    'module' => 'admin',
    'controller' => 'general',
    'action' => 'index',
));
$router->add("/admin/", array(
    'module' => 'admin',
    'controller' => 'general',
    'action' => 'index',
));
$router->add("/admin/logout", array(
    'module' => 'admin',
    'controller' => 'admin',
    'action' => 'logout',
));
$router->add("/admin/manage_page", array(
    'module' => 'admin',
    'controller' => 'general',
    'action' => 'page',
));

$router->add("/admin/manage_type", array(
    'module' => 'admin',
    'controller' => 'category',
    'action' => 'type',
));
$router->add("/admin/edit_type", array(
    'module' => 'admin',
    'controller' => 'category',
    'action' => 'editType',
));
$router->add("/admin/delete_doctype", array(
    'module' => 'admin',
    'controller' => 'category',
    'action' => 'deleteType',
));
$router->add("/admin/manage_topic", array(
    'module' => 'admin',
    'controller' => 'category',
    'action' => 'topic',
));
$router->add("/admin/edit_topic", array(
    'module' => 'admin',
    'controller' => 'category',
    'action' => 'editTopic',
));
$router->add("/admin/delete_topic", array(
    'module' => 'admin',
    'controller' => 'category',
    'action' => 'deleteTopic',
));
$router->add("/admin/manage_contact", array(
    'module' => 'admin',
    'controller' => 'general',
    'action' => 'contact',
));
$router->add("/admin/reply_support", array(
    'module' => 'admin',
    'controller' => 'general',
    'action' => 'reply',
));
$router->add("/admin/delete_support", array(
    'module' => 'admin',
    'controller' => 'general',
    'action' => 'deleteSupport',
));
$router->add("/admin/alluser", array(
    'module' => 'admin',
    'controller' => 'user',
    'action' => 'alluser',
));
$router->add("/admin/add_user", array(
    'module' => 'admin',
    'controller' => 'user',
    'action' => 'adduser',
));
$router->add("/admin/edit_user/{id}", array(
    'module' => 'admin',
    'controller' => 'user',
    'action' => 'edituser',
));
$router->add("/admin/delete_user", array(
    'module' => 'admin',
    'controller' => 'user',
    'action' => 'deleteuser',
));
$router->add("/admin/exchange", array(
    'module' => 'admin',
    'controller' => 'user',
    'action' => 'exchange',
));

$router->add("/admin/alldoc", array(
    'module' => 'admin',
    'controller' => 'doc',
    'action' => 'alldoc',
));
$router->add("/admin/add_doc", array(
    'module' => 'admin',
    'controller' => 'doc',
    'action' => 'add',
));
$router->add("/admin/edit_doc/{id}", array(
    'module' => 'admin',
    'controller' => 'doc',
    'action' => 'edit',
));
$router->add("/admin/delete_doc", array(
    'module' => 'admin',
    'controller' => 'doc',
    'action' => 'delete',
));
$router->add("/admin/public_doc", array(
    'module' => 'admin',
    'controller' => 'doc',
    'action' => 'public',
));
$router->add("/admin/user_upload", array(
    'module' => 'admin',
    'controller' => 'doc',
    'action' => 'upload',
));
$router->add("/admin/security", array(
    'module' => 'admin',
    'controller' => 'admin',
    'action' => 'security',
));
$router->add("/admin/config", array(
    'module' => 'admin',
    'controller' => 'admin',
    'action' => 'config',
));




/* ----- Topics ----- */

return $router;

